package org.jeecg.modules.xl.as.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * ${DESCRIPTION}
 * @author deco
 * @create 2025-03-15
*/
/**
 * 退货退款售后单主表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "xl_customer_as")
@ApiModel(value="售后单", description="售后单")
public class XlCustomerAs implements Serializable {
    /**
     * 售后单ID
     */
    @TableId(value = "as_id", type = IdType.ASSIGN_ID)
    private Long asId;

    /**
     * 售后单编码
     */
    @TableField(value = "as_code")
    @ApiModelProperty(value = "售后单编码")
    private String asCode;

    @TableField(value = "order_code")
    @ApiModelProperty(value = "订单号")
    private String orderCode;

    @TableField(value = "store_code")
    @ApiModelProperty(value = "门店编码")
    private String storeCode;

    @TableField(value = "store_name")
    @ApiModelProperty(value = "门店名称")
    private String storeName;
    /**
     * 售后类型
     */
    @TableField(value = "as_type")
    @ApiModelProperty(value = "售后类型")
    private String asType;
    /**
     * 退货地址Id
     */
    @TableField(value = "return_address_id")
    @ApiModelProperty(value = "退货地址Id")
    private String returnAddressId;
    /**
     * 售后状态
     */
    @TableField(value = "as_status")
    @ApiModelProperty(value = "售后状态")
    private String asStatus;

    /**
     * 申请原因
     */
    @TableField(value = "apply_reason")
    @ApiModelProperty(value = "申请原因")
    private String applyReason;

    /**
     * 申请金额
     */
    @TableField(value = "apply_amount")
    @ApiModelProperty(value = "申请金额")
    private BigDecimal applyAmount;

    @TableField(exist = false)
    private BigDecimal totalAmount;
    @TableField(value = "refund_amount")
    @ApiModelProperty(value = "实际退款金额")
    private BigDecimal refundAmount;

    /**
     * 商品总金额
     */
    @TableField(value = "product_total_amount")
    @ApiModelProperty(value = "商品总金额")
    private BigDecimal productTotalAmount;

    /**
     * 商品种类数量
     */
    @TableField(value = "product_category_count")
    @ApiModelProperty(value = "商品种类数量")
    private Integer productCategoryCount;

    /**
     * 商品总数量
     */
    @TableField(value = "product_total_quantity")
    @ApiModelProperty(value = "商品总数量")
    private Integer productTotalQuantity;

    /**
     * 申请凭证(存储图片URL数组)
     */
    @TableField(value = "apply_attachments")
    @ApiModelProperty(value = "申请凭证")
    private String applyAttachments;

    /**
     * 申请原因
     */
    @TableField(value = "as_notes")
    @ApiModelProperty(value = "申请备注")
    private String asNotes;

    /**
     * 是否同意:0-否 1-是
     */
    @TableField(value = "is_approved")
    @ApiModelProperty(value = "是否同意")
    private String isApproved;

    /**
     * 拒绝原因
     */
    @TableField(value = "reject_reason")
    @ApiModelProperty(value = "拒绝原因")
    private String rejectReason;

    /**
     * 租户ID
     */
    @TableField(value = "tenant_id")
    @JsonIgnore
    private Long tenantId;

    /**
     * 是否删除标志
     */
    @TableField(value = "is_deleted")
    @JsonIgnore
    private String isDeleted;

    /**
     * 创建人
     */
    @TableField(value = "create_by")
    @ApiModelProperty(value = "创建人")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField(value = "create_time",fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 更新人
     */
    @TableField(value = "update_by")
    @JsonIgnore
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
    @JsonIgnore
    private Date updateTime;

    @TableField(exist = false)
    @ApiModelProperty(value = "退货地址")
    private String returnAddress;

    @TableField(exist = false)
    @ApiModelProperty(value = "退货联系人电话")
    private String returnPhone;

    @TableField(exist = false)
    @ApiModelProperty(value = "退货联系人")
    private String returnContact;

    private static final long serialVersionUID = 1L;

}